3.1.28 \(\int \frac {d+e x+f x^2+g x^3}{(4-5 x^2+x^4)^2} \, dx\)

Optimal. Leaf size=138 \[ \frac {x \left (-\left (x^2 (5 d+8 f)\right )+17 d+20 f\right )}{72 \left (x^4-5 x^2+4\right )}+\frac {1}{432} (19 d+52 f) \tanh ^{-1}\left (\frac {x}{2}\right )-\frac {1}{54} (d+7 f) \tanh ^{-1}(x)+\frac {1}{54} (2 e+5 g) \log \left (1-x^2\right )-\frac {1}{54} (2 e+5 g) \log \left (4-x^2\right )+\frac {-\left (x^2 (2 e+5 g)\right )+5 e+8 g}{18 \left (x^4-5 x^2+4\right )} \]

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {1673, 1178, 1166, 207, 1247, 638, 616, 31} \begin {gather*} \frac {x \left (x^2 (-(5 d+8 f))+17 d+20 f\right )}{72 \left (x^4-5 x^2+4\right )}+\frac {1}{432} (19 d+52 f) \tanh ^{-1}\left (\frac {x}{2}\right )-\frac {1}{54} (d+7 f) \tanh ^{-1}(x)+\frac {x^2 (-(2 e+5 g))+5 e+8 g}{18 \left (x^4-5 x^2+4\right )}+\frac {1}{54} (2 e+5 g) \log \left (1-x^2\right )-\frac {1}{54} (2 e+5 g) \log \left (4-x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2 + g*x^3)/(4 - 5*x^2 + x^4)^2,x]

[Out]

(x*(17*d + 20*f - (5*d + 8*f)*x^2))/(72*(4 - 5*x^2 + x^4)) + (5*e + 8*g - (2*e + 5*g)*x^2)/(18*(4 - 5*x^2 + x^
4)) + ((19*d + 52*f)*ArcTanh[x/2])/432 - ((d + 7*f)*ArcTanh[x])/54 + ((2*e + 5*g)*Log[1 - x^2])/54 - ((2*e + 5
*g)*Log[4 - x^2])/54

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rule 638

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b*d - 2*a*e + (2*c*d -
b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[((2*p + 3)*(2*c*d - b*e))/((p + 1)*(b^2
- 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^
2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2]

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rule 1178

Int[((d_) + (e_.)*(x_)^2)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Simp[(x*(a*b*e - d*(b^2 - 2*
a*c) - c*(b*d - 2*a*e)*x^2)*(a + b*x^2 + c*x^4)^(p + 1))/(2*a*(p + 1)*(b^2 - 4*a*c)), x] + Dist[1/(2*a*(p + 1)
*(b^2 - 4*a*c)), Int[Simp[(2*p + 3)*d*b^2 - a*b*e - 2*a*c*d*(4*p + 5) + (4*p + 7)*(d*b - 2*a*e)*c*x^2, x]*(a +
 b*x^2 + c*x^4)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e
^2, 0] && LtQ[p, -1] && IntegerQ[2*p]

Rule 1247

Int[(x_)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[
Int[(d + e*x)^q*(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, d, e, p, q}, x]

Rule 1673

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{q = Expon[Pq, x], k}, Int[Sum[Coeff[
Pq, x, 2*k]*x^(2*k), {k, 0, q/2}]*(a + b*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pq, x, 2*k + 1]*x^(2*k), {k, 0,
(q - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] &&  !PolyQ[Pq, x^2]

Rubi steps

\begin {align*} \int \frac {d+e x+f x^2+g x^3}{\left (4-5 x^2+x^4\right )^2} \, dx &=\int \frac {d+f x^2}{\left (4-5 x^2+x^4\right )^2} \, dx+\int \frac {x \left (e+g x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx\\ &=\frac {x \left (17 d+20 f-(5 d+8 f) x^2\right )}{72 \left (4-5 x^2+x^4\right )}-\frac {1}{72} \int \frac {-d+20 f+(5 d+8 f) x^2}{4-5 x^2+x^4} \, dx+\frac {1}{2} \operatorname {Subst}\left (\int \frac {e+g x}{\left (4-5 x+x^2\right )^2} \, dx,x,x^2\right )\\ &=\frac {x \left (17 d+20 f-(5 d+8 f) x^2\right )}{72 \left (4-5 x^2+x^4\right )}+\frac {5 e+8 g-(2 e+5 g) x^2}{18 \left (4-5 x^2+x^4\right )}-\frac {1}{54} (-d-7 f) \int \frac {1}{-1+x^2} \, dx-\frac {1}{216} (19 d+52 f) \int \frac {1}{-4+x^2} \, dx+\frac {1}{18} (-2 e-5 g) \operatorname {Subst}\left (\int \frac {1}{4-5 x+x^2} \, dx,x,x^2\right )\\ &=\frac {x \left (17 d+20 f-(5 d+8 f) x^2\right )}{72 \left (4-5 x^2+x^4\right )}+\frac {5 e+8 g-(2 e+5 g) x^2}{18 \left (4-5 x^2+x^4\right )}+\frac {1}{432} (19 d+52 f) \tanh ^{-1}\left (\frac {x}{2}\right )-\frac {1}{54} (d+7 f) \tanh ^{-1}(x)+\frac {1}{54} (-2 e-5 g) \operatorname {Subst}\left (\int \frac {1}{-4+x} \, dx,x,x^2\right )+\frac {1}{54} (2 e+5 g) \operatorname {Subst}\left (\int \frac {1}{-1+x} \, dx,x,x^2\right )\\ &=\frac {x \left (17 d+20 f-(5 d+8 f) x^2\right )}{72 \left (4-5 x^2+x^4\right )}+\frac {5 e+8 g-(2 e+5 g) x^2}{18 \left (4-5 x^2+x^4\right )}+\frac {1}{432} (19 d+52 f) \tanh ^{-1}\left (\frac {x}{2}\right )-\frac {1}{54} (d+7 f) \tanh ^{-1}(x)+\frac {1}{54} (2 e+5 g) \log \left (1-x^2\right )-\frac {1}{54} (2 e+5 g) \log \left (4-x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 134, normalized size = 0.97 \begin {gather*} \frac {1}{864} \left (\frac {12 \left (-5 d x^3+17 d x+e \left (20-8 x^2\right )-8 f x^3+20 f x-4 g \left (5 x^2-8\right )\right )}{x^4-5 x^2+4}+8 \log (1-x) (d+4 e+7 f+10 g)-\log (2-x) (19 d+32 e+52 f+80 g)-8 \log (x+1) (d-4 e+7 f-10 g)+\log (x+2) (19 d-32 e+52 f-80 g)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2 + g*x^3)/(4 - 5*x^2 + x^4)^2,x]

[Out]

((12*(17*d*x + 20*f*x - 5*d*x^3 - 8*f*x^3 + e*(20 - 8*x^2) - 4*g*(-8 + 5*x^2)))/(4 - 5*x^2 + x^4) + 8*(d + 4*e
 + 7*f + 10*g)*Log[1 - x] - (19*d + 32*e + 52*f + 80*g)*Log[2 - x] - 8*(d - 4*e + 7*f - 10*g)*Log[1 + x] + (19
*d - 32*e + 52*f - 80*g)*Log[2 + x])/864

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d+e x+f x^2+g x^3}{\left (4-5 x^2+x^4\right )^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(d + e*x + f*x^2 + g*x^3)/(4 - 5*x^2 + x^4)^2,x]

[Out]

IntegrateAlgebraic[(d + e*x + f*x^2 + g*x^3)/(4 - 5*x^2 + x^4)^2, x]

________________________________________________________________________________________

fricas [B]  time = 2.86, size = 262, normalized size = 1.90 \begin {gather*} -\frac {12 \, {\left (5 \, d + 8 \, f\right )} x^{3} + 48 \, {\left (2 \, e + 5 \, g\right )} x^{2} - 12 \, {\left (17 \, d + 20 \, f\right )} x - {\left ({\left (19 \, d - 32 \, e + 52 \, f - 80 \, g\right )} x^{4} - 5 \, {\left (19 \, d - 32 \, e + 52 \, f - 80 \, g\right )} x^{2} + 76 \, d - 128 \, e + 208 \, f - 320 \, g\right )} \log \left (x + 2\right ) + 8 \, {\left ({\left (d - 4 \, e + 7 \, f - 10 \, g\right )} x^{4} - 5 \, {\left (d - 4 \, e + 7 \, f - 10 \, g\right )} x^{2} + 4 \, d - 16 \, e + 28 \, f - 40 \, g\right )} \log \left (x + 1\right ) - 8 \, {\left ({\left (d + 4 \, e + 7 \, f + 10 \, g\right )} x^{4} - 5 \, {\left (d + 4 \, e + 7 \, f + 10 \, g\right )} x^{2} + 4 \, d + 16 \, e + 28 \, f + 40 \, g\right )} \log \left (x - 1\right ) + {\left ({\left (19 \, d + 32 \, e + 52 \, f + 80 \, g\right )} x^{4} - 5 \, {\left (19 \, d + 32 \, e + 52 \, f + 80 \, g\right )} x^{2} + 76 \, d + 128 \, e + 208 \, f + 320 \, g\right )} \log \left (x - 2\right ) - 240 \, e - 384 \, g}{864 \, {\left (x^{4} - 5 \, x^{2} + 4\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="fricas")

[Out]

-1/864*(12*(5*d + 8*f)*x^3 + 48*(2*e + 5*g)*x^2 - 12*(17*d + 20*f)*x - ((19*d - 32*e + 52*f - 80*g)*x^4 - 5*(1
9*d - 32*e + 52*f - 80*g)*x^2 + 76*d - 128*e + 208*f - 320*g)*log(x + 2) + 8*((d - 4*e + 7*f - 10*g)*x^4 - 5*(
d - 4*e + 7*f - 10*g)*x^2 + 4*d - 16*e + 28*f - 40*g)*log(x + 1) - 8*((d + 4*e + 7*f + 10*g)*x^4 - 5*(d + 4*e
+ 7*f + 10*g)*x^2 + 4*d + 16*e + 28*f + 40*g)*log(x - 1) + ((19*d + 32*e + 52*f + 80*g)*x^4 - 5*(19*d + 32*e +
 52*f + 80*g)*x^2 + 76*d + 128*e + 208*f + 320*g)*log(x - 2) - 240*e - 384*g)/(x^4 - 5*x^2 + 4)

________________________________________________________________________________________

giac [A]  time = 0.25, size = 136, normalized size = 0.99 \begin {gather*} \frac {1}{864} \, {\left (19 \, d + 52 \, f - 80 \, g - 32 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) - \frac {1}{108} \, {\left (d + 7 \, f - 10 \, g - 4 \, e\right )} \log \left ({\left | x + 1 \right |}\right ) + \frac {1}{108} \, {\left (d + 7 \, f + 10 \, g + 4 \, e\right )} \log \left ({\left | x - 1 \right |}\right ) - \frac {1}{864} \, {\left (19 \, d + 52 \, f + 80 \, g + 32 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) - \frac {5 \, d x^{3} + 8 \, f x^{3} + 20 \, g x^{2} + 8 \, x^{2} e - 17 \, d x - 20 \, f x - 32 \, g - 20 \, e}{72 \, {\left (x^{4} - 5 \, x^{2} + 4\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="giac")

[Out]

1/864*(19*d + 52*f - 80*g - 32*e)*log(abs(x + 2)) - 1/108*(d + 7*f - 10*g - 4*e)*log(abs(x + 1)) + 1/108*(d +
7*f + 10*g + 4*e)*log(abs(x - 1)) - 1/864*(19*d + 52*f + 80*g + 32*e)*log(abs(x - 2)) - 1/72*(5*d*x^3 + 8*f*x^
3 + 20*g*x^2 + 8*x^2*e - 17*d*x - 20*f*x - 32*g - 20*e)/(x^4 - 5*x^2 + 4)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 242, normalized size = 1.75 \begin {gather*} \frac {5 g \ln \left (x -1\right )}{54}-\frac {5 g \ln \left (x +2\right )}{54}-\frac {5 g \ln \left (x -2\right )}{54}+\frac {5 g \ln \left (x +1\right )}{54}+\frac {19 d \ln \left (x +2\right )}{864}-\frac {e \ln \left (x +2\right )}{27}+\frac {e \ln \left (x -1\right )}{27}+\frac {d \ln \left (x -1\right )}{108}+\frac {e \ln \left (x +1\right )}{27}-\frac {d \ln \left (x +1\right )}{108}-\frac {19 d \ln \left (x -2\right )}{864}-\frac {e \ln \left (x -2\right )}{27}-\frac {13 f \ln \left (x -2\right )}{216}-\frac {7 f \ln \left (x +1\right )}{108}+\frac {7 f \ln \left (x -1\right )}{108}+\frac {13 f \ln \left (x +2\right )}{216}+\frac {g}{18 x +36}+\frac {g}{36 x +36}+\frac {e}{36 x +36}+\frac {e}{72 x +144}-\frac {g}{36 \left (x -1\right )}-\frac {g}{18 \left (x -2\right )}-\frac {d}{144 \left (x +2\right )}-\frac {d}{144 \left (x -2\right )}-\frac {e}{72 \left (x -2\right )}-\frac {d}{36 \left (x +1\right )}-\frac {d}{36 \left (x -1\right )}-\frac {e}{36 \left (x -1\right )}-\frac {f}{36 \left (x -1\right )}-\frac {f}{36 \left (x +2\right )}-\frac {f}{36 \left (x -2\right )}-\frac {f}{36 \left (x +1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x)

[Out]

5/54*g*ln(x-1)-5/54*g*ln(x+2)-5/54*g*ln(x-2)+5/54*g*ln(x+1)+19/864*d*ln(x+2)-1/27*e*ln(x+2)+1/27*e*ln(x-1)+1/1
08*d*ln(x-1)+1/27*e*ln(x+1)-1/108*d*ln(x+1)-19/864*d*ln(x-2)-1/27*e*ln(x-2)-13/216*f*ln(x-2)-7/108*f*ln(x+1)+7
/108*f*ln(x-1)+13/216*f*ln(x+2)+1/18/(x+2)*g+1/36/(x+1)*g-1/36/(x-1)*g-1/18/(x-2)*g-1/144/(x+2)*d+1/72/(x+2)*e
-1/144/(x-2)*d-1/72/(x-2)*e-1/36/(x+1)*d+1/36/(x+1)*e-1/36/(x-1)*d-1/36/(x-1)*e-1/36/(x-1)*f-1/36/(x+2)*f-1/36
/(x-2)*f-1/36/(x+1)*f

________________________________________________________________________________________

maxima [A]  time = 0.97, size = 127, normalized size = 0.92 \begin {gather*} \frac {1}{864} \, {\left (19 \, d - 32 \, e + 52 \, f - 80 \, g\right )} \log \left (x + 2\right ) - \frac {1}{108} \, {\left (d - 4 \, e + 7 \, f - 10 \, g\right )} \log \left (x + 1\right ) + \frac {1}{108} \, {\left (d + 4 \, e + 7 \, f + 10 \, g\right )} \log \left (x - 1\right ) - \frac {1}{864} \, {\left (19 \, d + 32 \, e + 52 \, f + 80 \, g\right )} \log \left (x - 2\right ) - \frac {{\left (5 \, d + 8 \, f\right )} x^{3} + 4 \, {\left (2 \, e + 5 \, g\right )} x^{2} - {\left (17 \, d + 20 \, f\right )} x - 20 \, e - 32 \, g}{72 \, {\left (x^{4} - 5 \, x^{2} + 4\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="maxima")

[Out]

1/864*(19*d - 32*e + 52*f - 80*g)*log(x + 2) - 1/108*(d - 4*e + 7*f - 10*g)*log(x + 1) + 1/108*(d + 4*e + 7*f
+ 10*g)*log(x - 1) - 1/864*(19*d + 32*e + 52*f + 80*g)*log(x - 2) - 1/72*((5*d + 8*f)*x^3 + 4*(2*e + 5*g)*x^2
- (17*d + 20*f)*x - 20*e - 32*g)/(x^4 - 5*x^2 + 4)

________________________________________________________________________________________

mupad [B]  time = 0.14, size = 128, normalized size = 0.93 \begin {gather*} \ln \left (x-1\right )\,\left (\frac {d}{108}+\frac {e}{27}+\frac {7\,f}{108}+\frac {5\,g}{54}\right )-\ln \left (x+1\right )\,\left (\frac {d}{108}-\frac {e}{27}+\frac {7\,f}{108}-\frac {5\,g}{54}\right )-\ln \left (x-2\right )\,\left (\frac {19\,d}{864}+\frac {e}{27}+\frac {13\,f}{216}+\frac {5\,g}{54}\right )+\ln \left (x+2\right )\,\left (\frac {19\,d}{864}-\frac {e}{27}+\frac {13\,f}{216}-\frac {5\,g}{54}\right )+\frac {\left (-\frac {5\,d}{72}-\frac {f}{9}\right )\,x^3+\left (-\frac {e}{9}-\frac {5\,g}{18}\right )\,x^2+\left (\frac {17\,d}{72}+\frac {5\,f}{18}\right )\,x+\frac {5\,e}{18}+\frac {4\,g}{9}}{x^4-5\,x^2+4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x + f*x^2 + g*x^3)/(x^4 - 5*x^2 + 4)^2,x)

[Out]

log(x - 1)*(d/108 + e/27 + (7*f)/108 + (5*g)/54) - log(x + 1)*(d/108 - e/27 + (7*f)/108 - (5*g)/54) - log(x -
2)*((19*d)/864 + e/27 + (13*f)/216 + (5*g)/54) + log(x + 2)*((19*d)/864 - e/27 + (13*f)/216 - (5*g)/54) + ((5*
e)/18 + (4*g)/9 - x^3*((5*d)/72 + f/9) - x^2*(e/9 + (5*g)/18) + x*((17*d)/72 + (5*f)/18))/(x^4 - 5*x^2 + 4)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4)**2,x)

[Out]

Timed out

________________________________________________________________________________________